# Uglyhack Car simulator
A rust program to simulate a car parking

Licensed under the GPL version 3.

Written for a still to be published video for https://diode.zone/a/uglyhack/video-channels

Basically there are three functions

## Drive around freely
In the root directly, do

    cargo run

q and w steer,
a and s zoom,
z and x adjust the speed,
r reverses,
and space pauses.

## Run a simulation
This runs through the movements from a file.

For example, in the root directory, do

    cargo run -- -f routes/reverse.txt

There are a number of routes in the routes directory.
In these files there are times, followed either by an angle (in radians) or the word "reverse".

It should start paused, and after you press space it should go through the steps

## Optimize a simulation
This attempts random changes to a loaded route in order to find a better one.
It just prints the results, you need to put them in a file to keep them.
Compiling in release mode is recommended for this.

    cargo run --release -- -f routes/backout_manual.txt --optimize

You can also set the --variation argument to change how big the random changes will be.
